/*
 * Copyright (C) 2019 Baidu, Inc. All Rights Reserved.
 */
package com.bootdo.hjh.domain;

public enum ProductType {
    UNKNOWN("NA", 0, 0),
    DU_XIAO_LI("杜小栗", 1, 5),
    HEI_MEI("黑莓", 2, 6)
    ;

    private String name;
    private Integer value;
    private Integer productId;

    ProductType(String name, Integer value, Integer productId) {
        this.name = name;
        this.value = value;
        this.productId = productId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public static ProductType getByValue(Integer value) {
        ProductType[] values = ProductType.values();
        for (ProductType productType : values) {
            if (productType.getValue().equals(value)) {
                return productType;
            }
        }
        return UNKNOWN;
    }
}
